
namespace Backoffice.Domain.Entities.App;


/// <summary>
/// 权限管理功能
/// </summary>
/// 
public class AppPermission : EntityBase
{
    public string Name { get; private set; } // 权限名称
    public string Description { get; private set; } // 权限描述

    // 导航属性
    public virtual ICollection<AppRolePermission> RolePermissions { get; private set; } = new List<AppRolePermission>();

#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
    private AppPermission() { }
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.

    public AppPermission(string code, string name, string description)
    {
        Code = code;
        Name = name;
        Description = description;
    }

    public void UpdateInfo(string name, string description)
    {
        Name = name;
        Description = description;
    }
}